<script lang="ts" setup>
// @ts-ignore
import {getTalkById} from "~/server/say.service";
// @ts-ignore
import markdownToHtml from "~/utils/markdown";

definePageMeta({
    layout: false,
})
useHead({
    bodyAttrs: {
        class: ' single single-post single-format-quote featured-image'
    }
})
const route = useRoute()
const sayInfo = ref('' as any)

function getSayInfo() {
    getTalkById(route.params.id).then(({data}: any) => {
        sayInfo.value = data.data
    })
}

onMounted(() => {
    getSayInfo()
})
</script>

<template>
    <NuxtLayout name="article">
        <template v-slot:nav>
            <Nav :title="sayInfo.content"/>
        </template>
        <template v-slot:header>
            <SayHeader :say="sayInfo"/>
        </template>
        <template v-slot:content>
            <div class="entry-content" v-html="markdownToHtml(String(sayInfo.article))"/>
        </template>
    </NuxtLayout>
</template>

<style scoped>

</style>
